package thread;

class MyRunnable01 implements Runnable{

    @Override
    public void run() {

        while(true){
            System.out.println("hello,Thread");

            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }


        }

    }
}


public class Demo7 {
    public static void main(String[] args) throws InterruptedException {
        MyRunnable01 myRunnable01 = new MyRunnable01();
        Thread t = new Thread(myRunnable01);

        t.start();

        while(true){
            System.out.println("hello,main");

            Thread.sleep(1000);

        }

    }
}
